package com.rmb.api.service.impl;

import com.rmb.api.dao.DroposerDao;
import com.rmb.api.entity.Droposer;
import com.rmb.api.service.DroposerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
/**
 * @author zhao
 */
@Service
public class DroposerServiceImpl implements DroposerService {

    @Autowired(required = false)
    private DroposerDao droposerDao;

    /**
     * 查询数据
     *
     * @param
     * @return 实例对象
     */
    @Override
    public List<Droposer> findAll() {

        Droposer droposer = new Droposer();
        droposer.setCreateTime(new Date());
        return droposerDao.findAll();
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public Droposer findById(Long id) {
        return droposerDao.findById(id);
    }

    /**
     *添加数据
     * @return
     * **/
    @Override
    public int insert(Droposer droposer) {
        return droposerDao.insert(droposer);
    }

    /**
     *修改数据
     * @return
     * **/
    @Override
    public int update(Droposer droposer) {
            return droposerDao.update(droposer);
    }

    /**
     *
     * 根据id查询
     *@return
     * **/
    @Override
    public int deleteById(Long id) {
        return droposerDao.deleteById(id);
    }


}
